#ifndef _MUSIC_H
#define _MUSIC_H

#include "stm32g0xx_hal.h"
#include "config.h"

enum
{
	STANDBY_SOUND_ID = 0x00,
	INSERT_COIN_SOUND_ID = 0x01,
	GET_READY_SPEECH_ID = 0x02,
	ONE_SPEECH_ID,
	TWO_SPEECH_ID,
	THREE_SPEECH_ID,
	GO_SPEECH_ID = 0x03,
	GAME_SOUND_ID = 0x04,
	GOAL_SOUND_ID = 0x05,
	GAME_OVER_SOUND_ID  = 0x06,
	GOAL_JACKPOT_SOUND_ID  = 0x07,
	WARNING_SOUND_ID  = 0x08,
	CLEAR_ALARM_ID = 0x09
};
enum
{
	channel1 = 0x00,
	channel2 = 0x01,
	channel3 = 0x02,
	channel4 = 0x03
};
enum
{
	STANDBY_SOUND_CH = channel1,
	INSERT_COIN_SOUND_CH = channel3,
	GET_READY_SPEECH_CH = channel2,
	ONE_SPEECH_CH = channel2,
	TWO_SPEECH_CH = channel2,
	THREE_SPEECH_CH = channel2,
	GO_SPEECH_CH = channel2,
	GAME_SOUND_CH = channel1,
	GOAL_SOUND_CH = channel3,
	GOAL_JACKPOT_SOUND_CH = channel3,
	WARNING_SOUND_CH = channel4,
	CLEAR_ALARM_CH = channel2
};

typedef struct _MUSIC_INFO
{
	u8 once;
	u8 id;
	u8 statue;
	u8 cmd;
}Music_Info_Typedef;
extern Music_Info_Typedef music_struct;
void Init_ML22420_Music(void);
void Music_GPIO_Config(void);
u8 Music_Send_CMD(u8 cmd);
void Music_Stop(u8 channel);
u8 Get_Music_ID(void);

u8 Music_Play(u8 id,u8 channel,u8 loop);
void Music_PowerUp(void);
u8 Music_Amode(u8 cmd);

#endif
